---
title: Stack
description: "`Stack`は、要素をグループ化し、子要素間にスペースを設けるコンポーネントです。"
storybook: components-stack--basic
source: components/stack
style: components/stack/stack.style.ts
---

```tsx preview
<Stack>
  {Array.from({ length: 4 }).map((_, index) => (
    <Box key={index} bg="bg.contrast" color="fg.contrast" p="md">
      Box
    </Box>
  ))}
</Stack>
```

## 使い方

:::code-group

```tsx [package]
import { Stack } from "@yamada-ui/react"
```

```tsx [alias]
import { Stack } from "@/components/ui"
```

```tsx [monorepo]
import { Stack } from "@workspaces/ui"
```

:::

```tsx
<Stack />
```

### 子要素間に区切り線を設ける

```tsx preview
<Stack separator={<Separator />}>
  {Array.from({ length: 4 }).map((_, index) => (
    <Box key={index} bg="bg.contrast" color="fg.contrast" p="md">
      Box
    </Box>
  ))}
</Stack>
```

## Props

<PropsTable name="stack" pick={["Stack"]} />
